package com.antcloud.demo.antscheduler.handlers;

import com.alipay.antschedulerclient.common.ClientCommonResult;
import com.alipay.antschedulerclient.handler.IClusterJobExecuteHandler;
import com.alipay.antschedulerclient.model.ClusterJobExecuteContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ThreadPoolExecutor;

/**
 * @author manxing
 * @date 2018/9/2
 */
public class ClusterJobExecutor implements IClusterJobExecuteHandler {

    private final Logger LOGGER = LoggerFactory.getLogger(getClass());


    @Override
    public ClientCommonResult handle(ClusterJobExecuteContext context) {
        LOGGER.info("ClusterJobExecutor %s,%s,%s", context.getChunk(), context.getHandler(), context.getRequestId());
        return ClientCommonResult.buildSuccessResult();
    }

    @Override
    public String getName() {
        return "ANTSCHEDULER_CLUSTER_EXECUTOR";
    }

    @Override
    public ThreadPoolExecutor getThreadPool() {
        return null;
    }
}
